data_table Derived Type

type, public :: data_table

Defines a table of data.


Finalization Procedures

final :: dt_finalize

  • private subroutine dt_finalize(this)

    Releases the state retained by a table when it leaves scope.

    Arguments

    Type IntentOptional Attributes Name
    type(data_table), intent(inout) :: this

    The table being finalized.


Type-Bound Procedures

procedure, public :: add_column => dt_add_column

  • private subroutine dt_add_column(this, col)

    Appends an owned copy of a column to the table.

    Arguments

    Type IntentOptional Attributes Name
    class(data_table), intent(inout) :: this

    The table receiving the column.

    class(data_column), intent(in) :: col

    The column to copy; its row count must match the table.

procedure, public :: column_count => dt_column_count

  • private pure function dt_column_count(this) result(rst)

    Gets the number of columns in the data table.

    Arguments

    Type IntentOptional Attributes Name
    class(data_table), intent(in) :: this

    The table being queried.

    Return Value integer(kind=int32)

    The number of columns.

procedure, public :: get_column => dt_get_column

  • private function dt_get_column(this, col) result(rst)

    Gets a borrowed pointer to a stored column without copying it. The pointer survives insertion, but removal of that column or release of the final table/view owner invalidates it.

    Arguments

    Type IntentOptional Attributes Name
    class(data_table), intent(in) :: this

    The table being queried.

    integer(kind=int32), intent(in) :: col

    One-based position of the requested column.

    Return Value class(data_column), pointer

    The stored column; invalid indices cause an error stop.

procedure, public :: insert_column => dt_insert_column

  • private subroutine dt_insert_column(this, index, col)

    Inserts an owned copy of a column at the requested position.

    Arguments

    Type IntentOptional Attributes Name
    class(data_table), intent(inout) :: this

    The table receiving the column.

    integer(kind=int32), intent(in) :: index

    One-based insertion position, from one through count plus one.

    class(data_column), intent(in) :: col

    The column to copy; its row count must match the table.

procedure, public :: remove_column => dt_remove_column

  • private subroutine dt_remove_column(this, col)

    Removes a column from the table and shifts later positions left.

    Arguments

    Type IntentOptional Attributes Name
    class(data_table), intent(inout) :: this

    The table from which the column is removed.

    integer(kind=int32), intent(in) :: col

    One-based position of the column to remove.

procedure, public :: row_count => dt_row_count

  • private function dt_row_count(this) result(rst)

    Gets the number of rows in the data table.

    Arguments

    Type IntentOptional Attributes Name
    class(data_table), intent(in) :: this

    The table being queried.

    Return Value integer(kind=int32)

    The number of rows, or zero when there are no columns.

procedure, public :: slice => dt_slice

  • private function dt_slice(this, first, last) result(rst)

    Creates a live row slice spanning all current and future columns.

    Arguments

    Type IntentOptional Attributes Name
    class(data_table), intent(inout) :: this

    The source table whose shared state is retained.

    integer(kind=int32), intent(in) :: first

    First selected one-based row position.

    integer(kind=int32), intent(in) :: last

    Inclusive final row position.

    Return Value type(data_table_view)

    A view restricted to the requested row positions.

procedure, public :: view => dt_view

  • private function dt_view(this, row_first, row_last, column_first, column_last) result(rst)

    Creates a live view using optional one-based row and column bounds. Bounds are reapplied to current positions and clipped to the current table shape, so structural edits can change the selected values. Omitted final bounds expand as rows or columns are appended; explicit final bounds remain fixed.

    Arguments

    Type IntentOptional Attributes Name
    class(data_table), intent(inout) :: this

    The source table whose shared state is retained.

    integer(kind=int32), intent(in), optional :: row_first

    First selected row; defaults to one.

    integer(kind=int32), intent(in), optional :: row_last

    Inclusive final row; omitted means through the current final row.

    integer(kind=int32), intent(in), optional :: column_first

    First selected column; defaults to one.

    integer(kind=int32), intent(in), optional :: column_last

    Inclusive final column; omitted means through the current final column.

    Return Value type(data_table_view)

    The live positional view.